Skip to main content

is strictly

Type

operator

Summary

Compares two values and evaluates to true if they are equal as they are, false otherwise.

Syntax

<value1> is strictly <value2>

Description

Use the is strictly operator determine whether two expressions generate exactly the same value.

Unlike the = operator, the is strictly operator compares the two values exactly as they are, without any type conversion, ignoring the caseSensitive and formSensitive properties.

If the first value is strictly nothing, then the second value must also be strictly nothing.

If the first value is strictly a boolean, then the second value must also be strictly a boolean, and the boolean values must be the same.

If the first value is strictly a number, then the second value must also be strictly a number, and the numeric values must be the same.

If the first value is strictly a string, then the second value must also be strictly a string, and the string values must be made up of exactly the same sequence of codepoints.

If the first value is strictly a binary string, then second value must also be strictly a binary string, and the binary string values must be made up of exactly the same sequence of bytes.

If the first value is strictly an array, then second value must also be strictly an array, and the array values must have exactly the same keys, where each key's value in the first array is strictly the same key's value in the second array.

If the first value is strictly a sequence, then second value must also be strictly a sequence, the number of elements be the same in both, and each element in the first array is strictly the element in the second array.

If the first value is strictly a dictionary, then second value must also be strictly a dictionary, and the array values must have exactly the same keys, where each key's value in the first array is strictly the same key's value in the second array.

Parameters

NameTypeDescription

value1

The operand value1 can be a number, literal string of characters (delimited with double quotes), or any source of value.

value2

The operand value2 can be a number, literal string of characters (delimited with double quotes), or any source of value.

Examples

"" is strictly nothing -- evaluates to false
true is strictly true -- evaluates to true
"false" is strictly false -- evaluates to false
(1.5 - 0.5) is strictly the number of items in "_" -- evaluates to true
"Foo" is strictly "foo" -- evaluates to false
empty is strictly [1, 2] -- evaluates to false
[ [ "foo" ], "bar" ] is strictly [ [ "foo" ], "bar" ] -- evaluates to true
[ [ "Foo" ], "bar" ] is strictly [ [ "foo" ], "bar" ] -- evaluates to false
[] is strictly {} -- evaluates to false
[ 1, 2 ] is strictly { "1": 1, "2": 2 } -- evaluates to false

operator: equals, is strictly a, as a

property: caseSensitive, formSensitive

glossary: operator, value, byte, key

keyword: codepoint

Compatibility and Support

Introduced

LiveCode 10.0

OS

mac

windows

linux

ios

android

web

Platforms

desktop

server

mobile

Thank you for your feedback!

Was this page helpful?